package com.oc.mba.entity;

import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.OrderBy;

import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * OcQuestion entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "oc_question", catalog = "openmba")
public class OcQuestion implements java.io.Serializable {

	// Fields

	private Integer id;
	private String questionSerial;
	private Integer questionType;
	private Integer questionIndex;
	private String questionTitle;
	private String questionSummary;
	private Short questionStatus;
	private String questionTag;
	private String questionImage;
	private String questionImage1;
	private String questionImage2;
	private Set<OcQuestionOption> ocQuestionOptions = new HashSet<OcQuestionOption>(
			0);
	private Set<OcQuestionTechnique> ocQuestionTechniques = new HashSet<OcQuestionTechnique>(
			0);
	private Set<OcQuestionSolution> ocQuestionSolutions = new HashSet<OcQuestionSolution>(
			0);
	private Set<OcQuestionSeckill> ocQuestionSeckills = new HashSet<OcQuestionSeckill>(
			0);

	// Constructors

	/** default constructor */
	public OcQuestion() {
	}

	/** minimal constructor */
	public OcQuestion(Integer questionType, Integer questionIndex,
			String questionTitle) {
		this.questionType = questionType;
		this.questionIndex = questionIndex;
		this.questionTitle = questionTitle;
	}

	/** full constructor */
	public OcQuestion(String questionSerial, Integer questionType,
			Integer questionIndex, String questionTitle,
			String questionSummary, Short questionStatus, String questionTag,
			String questionImage, String questionImage1, String questionImage2,
			Set<OcQuestionOption> ocQuestionOptions,
			Set<OcQuestionTechnique> ocQuestionTechniques,
			Set<OcQuestionSolution> ocQuestionSolutions,
			Set<OcQuestionSeckill> ocQuestionSeckills) {
		this.questionSerial = questionSerial;
		this.questionType = questionType;
		this.questionIndex = questionIndex;
		this.questionTitle = questionTitle;
		this.questionSummary = questionSummary;
		this.questionStatus = questionStatus;
		this.questionTag = questionTag;
		this.questionImage = questionImage;
		this.questionImage1 = questionImage1;
		this.questionImage2 = questionImage2;
		this.ocQuestionOptions = ocQuestionOptions;
		this.ocQuestionTechniques = ocQuestionTechniques;
		this.ocQuestionSolutions = ocQuestionSolutions;
		this.ocQuestionSeckills = ocQuestionSeckills;
	}

	// Property accessors
	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "id", unique = true, nullable = false)
	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	@Column(name = "question_serial")
	public String getQuestionSerial() {
		return this.questionSerial;
	}

	public void setQuestionSerial(String questionSerial) {
		this.questionSerial = questionSerial;
	}

	@Column(name = "question_type", nullable = false)
	public Integer getQuestionType() {
		return this.questionType;
	}

	public void setQuestionType(Integer questionType) {
		this.questionType = questionType;
	}

	@Column(name = "question_index", nullable = false)
	public Integer getQuestionIndex() {
		return this.questionIndex;
	}

	public void setQuestionIndex(Integer questionIndex) {
		this.questionIndex = questionIndex;
	}

	@Column(name = "question_title", nullable = false)
	public String getQuestionTitle() {
		return this.questionTitle;
	}

	public void setQuestionTitle(String questionTitle) {
		this.questionTitle = questionTitle;
	}

	@Column(name = "question_summary")
	public String getQuestionSummary() {
		return this.questionSummary;
	}

	public void setQuestionSummary(String questionSummary) {
		this.questionSummary = questionSummary;
	}

	@Column(name = "question_status")
	public Short getQuestionStatus() {
		return this.questionStatus;
	}

	public void setQuestionStatus(Short questionStatus) {
		this.questionStatus = questionStatus;
	}

	@Column(name = "question_tag")
	public String getQuestionTag() {
		return this.questionTag;
	}

	public void setQuestionTag(String questionTag) {
		this.questionTag = questionTag;
	}

	@Column(name = "question_image")
	public String getQuestionImage() {
		return this.questionImage;
	}

	public void setQuestionImage(String questionImage) {
		this.questionImage = questionImage;
	}

	@Column(name = "question_image1")
	public String getQuestionImage1() {
		return this.questionImage1;
	}

	public void setQuestionImage1(String questionImage1) {
		this.questionImage1 = questionImage1;
	}

	@Column(name = "question_image2")
	public String getQuestionImage2() {
		return this.questionImage2;
	}

	public void setQuestionImage2(String questionImage2) {
		this.questionImage2 = questionImage2;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER, mappedBy = "ocQuestion")
	@OrderBy("id ASC")
	public Set<OcQuestionOption> getOcQuestionOptions() {
		return this.ocQuestionOptions;
	}

	public void setOcQuestionOptions(Set<OcQuestionOption> ocQuestionOptions) {
		this.ocQuestionOptions = ocQuestionOptions;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER, mappedBy = "ocQuestion")
	@OrderBy("id ASC")
	public Set<OcQuestionTechnique> getOcQuestionTechniques() {
		return this.ocQuestionTechniques;
	}

	public void setOcQuestionTechniques(
			Set<OcQuestionTechnique> ocQuestionTechniques) {
		this.ocQuestionTechniques = ocQuestionTechniques;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER, mappedBy = "ocQuestion")
	@OrderBy("id ASC")
	public Set<OcQuestionSolution> getOcQuestionSolutions() {
		return this.ocQuestionSolutions;
	}

	public void setOcQuestionSolutions(
			Set<OcQuestionSolution> ocQuestionSolutions) {
		this.ocQuestionSolutions = ocQuestionSolutions;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER, mappedBy = "ocQuestion")
	@OrderBy("id ASC")
	public Set<OcQuestionSeckill> getOcQuestionSeckills() {
		return this.ocQuestionSeckills;
	}

	public void setOcQuestionSeckills(Set<OcQuestionSeckill> ocQuestionSeckills) {
		this.ocQuestionSeckills = ocQuestionSeckills;
	}

}